package com.tanhua.dubbo.api;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.tanhua.dubbo.mappers.QuestionsMapper;
import com.tanhua.model.domain.Questions;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

@DubboService
public class QuestionsApiImpl implements QuestionsApi{

    @Autowired
    private QuestionsMapper questionsMapper;

    @Override
    public int count() {
        QueryWrapper qw = new QueryWrapper();
        int count = questionsMapper.selectCount(qw);
        return count;
    }

    @Override
    public List<Questions> findByIds(List random) {

        QueryWrapper qw = new QueryWrapper();
        qw.in("q_id",random);
        List<Questions> list = questionsMapper.selectList(qw);

        return list;
    }
}
